home *** CD-ROM | disk | FTP | other *** search
- Path: noc.tor.hookup.net!news
- From: Rajendra_Singh@msn.com (Rajendra Singh)
- Newsgroups: comp.lang.c
- Subject: Re: Character String --> Integer
- Date: Thu, 08 Feb 1996 03:35:49 GMT
- Organization: HookUp Communication Corporation, Oakville, Ontario, CANADA
- Message-ID: <4fbfvi$7f@noc.tor.hookup.net>
- References: <4fb0ga$lsa@remus.rutgers.edu>
- NNTP-Posting-Host: u36u400.tor.hookup.net
- NNTP-Posting-User: u36u400
- X-Newsreader: Forte Free Agent 1.0.82
-
- wempa@remus.rutgers.edu (Force Of Nature) wrote:
-
- >Is there an easy way to convert a character string such as '2425' to the
- >integer 2425 ??? The only way I can think of is to pick off characters
- >one at a time and use switch statements to determine the value (0-9) and
- >then multiply by the correct power of 10. Is there an easier way to do
- >this ???????
-
- int number;
-
- number = atoi(string);
- ---
- Rajendra Singh, B. Sc. (Rajendra_Singh@msn.com)
- "What is understood need not be discussed." - Loren Adams
-
-